package base

import (
	log "github.com/sirupsen/logrus"
	"reflect"
)

//初始化化接口，
type Initializer interface {
	//初始化，用于对象实例化后的对象初始化操作
	Init()
}

type InitializerRegister struct {
	Initializers []Initializer
}

func (r *InitializerRegister) Register(ai Initializer) {
	r.Initializers = append(r.Initializers, ai)
	typ := reflect.TypeOf(ai)
	log.Infof("Register Initializer: %s", typ.String())
}
